(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define([], factory);
	else if(typeof exports === 'object')
		exports["ToolBar"] = factory();
	else
		root["grimm"] = root["grimm"] || {}, root["grimm"]["ToolBar"] = factory();
})(typeof self !== 'undefined' ? self : this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "./";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 310);
/******/ })
/************************************************************************/
/******/ ({

/***/ 13:
/***/ (function(module, exports) {

/* globals __VUE_SSR_CONTEXT__ */

// this module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle

module.exports = function normalizeComponent (
  rawScriptExports,
  compiledTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */
) {
  var esModule
  var scriptExports = rawScriptExports = rawScriptExports || {}

  // ES6 modules interop
  var type = typeof rawScriptExports.default
  if (type === 'object' || type === 'function') {
    esModule = rawScriptExports
    scriptExports = rawScriptExports.default
  }

  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (compiledTemplate) {
    options.render = compiledTemplate.render
    options.staticRenderFns = compiledTemplate.staticRenderFns
  }

  // scopedId
  if (scopeId) {
    options._scopeId = scopeId
  }

  var hook
  if (moduleIdentifier) { // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = injectStyles
  }

  if (hook) {
    var functional = options.functional
    var existing = functional
      ? options.render
      : options.beforeCreate
    if (!functional) {
      // inject component registration as beforeCreate hook
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    } else {
      // register for functioal component in vue file
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return existing(h, context)
      }
    }
  }

  return {
    esModule: esModule,
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 310:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(311)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports, require('../../components/ToolBar'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports, global.ToolBar);
    global.index = mod.exports;
  }
})(this, function (module, exports, _ToolBar) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _ToolBar2 = _interopRequireDefault(_ToolBar);

  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  _ToolBar2.default.install = function (Vue) {
    Vue.component(_ToolBar2.default.name, _ToolBar2.default);
  };

  exports.default = _ToolBar2.default;
  module.exports = exports['default'];
});

/***/ }),

/***/ 311:
/***/ (function(module, exports, __webpack_require__) {

function injectStyle (ssrContext) {
  __webpack_require__(312)
}
var Component = __webpack_require__(13)(
  /* script */
  __webpack_require__(313),
  /* template */
  __webpack_require__(318),
  /* styles */
  injectStyle,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),

/***/ 312:
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ 313:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(314)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports, require('./toolbar-item'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports, global.toolbarItem);
    global.index = mod.exports;
  }
})(this, function (module, exports, _toolbarItem) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _toolbarItem2 = _interopRequireDefault(_toolbarItem);

  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  var name = 'grimm-toolbar';
  exports.default = {
    name: name,
    components: { GrimmToolbarItme: _toolbarItem2.default },
    data: function data() {
      return {
        barIndex: 0,
        barLable: this.data.length && this.data[0].label,
        moreBarIndex: null,
        visibleMore: false
      };
    },

    props: {
      data: {
        type: Array,
        default: function _default() {
          return [];
        }
      },
      clickHandler: {
        type: Function,
        default: function _default(_) {
          return _;
        }
      },
      barNum: {
        type: [Number, String],
        default: function _default() {
          return 4;
        }
      },
      animation: {
        type: String,
        default: function _default() {
          return '';
        }
      }
    },
    computed: {
      tagClass: function tagClass() {
        if (this.visibleMore) {
          return 'grimm-tool-bar-active';
        }
        return '';
      },
      currentData: function currentData() {
        return this.data.length > this.getBarNum() ? this.data.slice(0, this.getBarNum()) : this.data;
      },
      moreData: function moreData() {
        return this.data.length > this.getBarNum() ? this.data.slice(this.getBarNum(), this.data.length) : [];
      }
    },
    mounted: function mounted() {},

    methods: {
      onClickTab: function onClickTab(label, index) {
        if (this.visibleMore) {
          return;
        }
        this.barIndex = index;
        this.barLable = label;
        this.clickHandler(label, index);
      },
      onClickMoreTab: function onClickMoreTab(label, index) {
        this.moreBarIndex = index;
        this.clickHandler(label, index + Number(this.barNum));
      },
      onClickMore: function onClickMore() {
        this.visibleMore = !this.visibleMore;
        this.moreBarIndex = null;
        if (!this.visibleMore) {
          this.clickHandler(this.barLable, this.barIndex);
        }
      },
      getBarNum: function getBarNum() {
        return Number(this.barNum) || 4;
      }
    }
  };
  module.exports = exports['default'];
});

/***/ }),

/***/ 314:
/***/ (function(module, exports, __webpack_require__) {

function injectStyle (ssrContext) {
  __webpack_require__(315)
}
var Component = __webpack_require__(13)(
  /* script */
  __webpack_require__(316),
  /* template */
  __webpack_require__(317),
  /* styles */
  injectStyle,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),

/***/ 315:
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ 316:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports);
    global.toolbarItem = mod.exports;
  }
})(this, function (module, exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });


  var name = 'grimm-toolbar-item';
  exports.default = {
    name: name,
    props: {
      index: {
        type: [Number, String],
        default: function _default() {
          return 0;
        }
      },
      barIndex: {
        type: [Number, String],
        default: function _default() {
          return 0;
        }
      },
      label: {
        type: String,
        default: function _default() {
          return '';
        }
      },
      icon: {
        type: String,
        default: ''
      },
      visibleMore: {
        type: Boolean,
        default: false
      },
      onHandler: {
        type: Function,
        default: function _default(_) {
          return _;
        }
      },
      animation: {
        type: String,
        default: function _default() {
          return '';
        }
      }
    },
    computed: {
      activeClass: function activeClass() {
        if (this.index === this.barIndex && !this.visibleMore) {
          return 'grimm-tool-bar-active grimm-tool-bar-active-' + this.animation;
        }
        return '';
      }
    },
    methods: {
      onClick: function onClick(e, label, index) {
        e.preventDefault();
        this.onHandler(label, index);
      }
    }
  };
  module.exports = exports['default'];
});

/***/ }),

/***/ 317:
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    staticClass: "grimm-tool-bar-item",
    class: _vm.activeClass,
    on: {
      "click": function (e) { return _vm.onClick(e, _vm.label, _vm.index); }
    }
  }, [_c('p', [(_vm.icon) ? _c('i', {
    staticClass: "iconfont",
    class: _vm.icon
  }) : _vm._e()]), _vm._v(" "), _c('p', {
    staticClass: "grimm-tool-bar-label"
  }, [_vm._v(_vm._s(_vm.label))])])
},staticRenderFns: []}

/***/ }),

/***/ 318:
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    staticClass: "grimm-tool-bar-box"
  }, [_c('div', {
    staticClass: "grimm-tool-bar"
  }, [_vm._l((_vm.currentData), function(item, index) {
    return _c('grimm-toolbar-itme', {
      key: index,
      attrs: {
        "index": index,
        "barIndex": _vm.barIndex,
        "label": item.label,
        "icon": item.icon,
        "onHandler": _vm.onClickTab,
        "visibleMore": _vm.visibleMore,
        "animation": _vm.animation
      }
    })
  }), _vm._v(" "), (_vm.data && _vm.data.length > this.getBarNum() && _vm.visibleMore) ? _c('div', {
    staticClass: "tool-bar-more"
  }, _vm._l((_vm.moreData), function(item, index) {
    return _c('grimm-toolbar-itme', {
      key: index,
      attrs: {
        "index": index,
        "barIndex": _vm.moreBarIndex,
        "label": item.label,
        "icon": item.icon,
        "onHandler": _vm.onClickMoreTab,
        "animation": _vm.animation
      }
    })
  }), 1) : _vm._e(), _vm._v(" "), (_vm.data && _vm.data.length > this.getBarNum()) ? _c('div', {
    staticClass: "grimm-tool-bar-item",
    class: _vm.tagClass,
    on: {
      "click": _vm.onClickMore
    }
  }, [_c('p', [_vm._v("...")]), _vm._v(" "), _c('p', [_vm._v("更多")])]) : _vm._e()], 2)])
},staticRenderFns: []}

/***/ })

/******/ });
});